﻿<sdk:Page
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:viewModels="clr-namespace:MedLink2011.Views.Patients.ViewModels" 
xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" 
xmlns:Controls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Data" 
xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
xmlns:E2C="clr-namespace:MedLink2011.Core"
xmlns:appControls="clr-namespace:MedLink2011.Controls"
xmlns:telerik1="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls" 
x:Class="MedLink2011.Views.Patients.WorkWithGrid.PatientsWorkWithGrid"
mc:Ignorable="d"
d:DesignWidth="840" d:DesignHeight="480"

Title="Patients Grid"
>
    <sdk:Page.Resources>
        <viewModels:PatientViewModel x:Key="PatientViewModel" />
    </sdk:Page.Resources>
    <appControls:BusyIndicator x:Name="BusyIndicator" BusyContent="Loading Patient data...." DataContext="{Binding Source={StaticResource PatientViewModel}}" FontSize="18"  IsBusy="{Binding IsBusy}">
        <ScrollViewer x:Name="scrollViewerPatients" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" >
    <Grid x:Name="LayoutRoot" DataContext="{Binding Source={StaticResource PatientViewModel}}" Background="#FF8D8C89" >
    <Grid.RowDefinitions>
        <RowDefinition Height="40" />
            <RowDefinition Height="300*" />
         </Grid.RowDefinitions>
        <Grid.ColumnDefinitions >
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="230*" />
        </Grid.ColumnDefinitions>
        <StackPanel Grid.Column="0" Grid.Row="0" Height="34" HorizontalAlignment="Left" Orientation="Horizontal" VerticalAlignment="Top" Width="Auto">
            <Button  Background="#FF62A3DB" x:Name="printListButton" Content="Print List"  Margin="2"   Height="30" FontSize="11" Click="printListButton_Click"  />
            <Button  Background="#FF62A3DB" x:Name="printButton" Content="Print Selected"  Margin="2"  Height="30" FontSize="11" Command="{Binding PrintPatientCommand}"  />
            <Button Background="#FF62A3DB" x:Name="addButton" Content="Add New" Margin="2"   Height="30" FontSize="11" Command="{Binding AddNewPatientCommand}" />
            <Button  Background="#FF62A3DB" x:Name="EditCurrentInNewWindowButton" Content="Edit Selected"  Margin="2"   Height="30" FontSize="11" Click="EditCurrentInNewWindowButton_Click"  />
            <Button Background="#FF62A3DB"  x:Name="deleteButton" Content="Delete Selected" Margin="2"   Height="30" FontSize="11" Command="{Binding DeletePatientCommand}" />
            <Button Background="#FF62A3DB"  x:Name="Export2ExcelButton" Content="Export to Excel" Margin="2"   Height="30" FontSize="11" Click="Export2ExcelButton_Click" />
        </StackPanel>
                        <ScrollViewer Grid.Column="1" Grid.Row="1" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" >
                    <StackPanel   HorizontalAlignment="Left" Orientation="Vertical" VerticalAlignment="Top"  Margin="2">
                    <!--<Button  x:Name="ShowAppointmentsButton" Content="Citas" Width="200" Margin="2"   Height="30" FontSize="11" Command="{Binding ShowChartDashboardCommand}" CommandParameter="{Binding SelectedItem, ElementName=PatientDataGridTelerik}" />-->
                    <Button Background="#FF6BB6F7" x:Name="ShowAppointmentsButton" Content="Appointments" Width="200" Margin="2"   Height="30" FontSize="11" Click="GoToAppointmentsButtonClick"  />
                    <Button Background="#FF6BB6F7" x:Name="ShowClinicChartsButton" Content="Clinic Charts" Width="200" Margin="2"   Height="30" FontSize="11" Click="GoToClinicChartsButtonClick"  />
                    <Button Background="#FF6BB6F7" x:Name="ShowConsult_PaymentsButton" Content="Consult Payments" Width="200" Margin="2"   Height="30" FontSize="11" Click="GoToConsult_PaymentsButtonClick"  />
                    <Button Background="#FF6BB6F7" x:Name="ShowConsultationsButton" Content="Consultations" Width="200" Margin="2"   Height="30" FontSize="11" Click="GoToConsultationsButtonClick"  />
                    <Button Background="#FF6BB6F7" x:Name="ShowDiagnosButton" Content="Diagnos" Width="200" Margin="2"   Height="30" FontSize="11" Click="GoToDiagnosButtonClick"  />
                    <Button Background="#FF6BB6F7" x:Name="ShowExamsButton" Content="Exams" Width="200" Margin="2"   Height="30" FontSize="11" Click="GoToExamsButtonClick"  />
                    <Button Background="#FF6BB6F7" x:Name="ShowInpatient_regsButton" Content="Inpatient Regs" Width="200" Margin="2"   Height="30" FontSize="11" Click="GoToInpatient_regsButtonClick"  />
                    <Button Background="#FF6BB6F7" x:Name="ShowInvoicesButton" Content="Invoices" Width="200" Margin="2"   Height="30" FontSize="11" Click="GoToInvoicesButtonClick"  />
                    <Button Background="#FF6BB6F7" x:Name="ShowLabsButton" Content="Labs" Width="200" Margin="2"   Height="30" FontSize="11" Click="GoToLabsButtonClick"  />
                    <Button Background="#FF6BB6F7" x:Name="ShowMedical_HistosButton" Content="Medical Histos" Width="200" Margin="2"   Height="30" FontSize="11" Click="GoToMedical_HistosButtonClick"  />
                    <Button Background="#FF6BB6F7" x:Name="ShowMedicationReactionsButton" Content="Medication Reactions" Width="200" Margin="2"   Height="30" FontSize="11" Click="GoToMedicationReactionsButtonClick"  />
                    <Button Background="#FF6BB6F7" x:Name="ShowPatientAllergiesButton" Content="Patient Allergies" Width="200" Margin="2"   Height="30" FontSize="11" Click="GoToPatientAllergiesButtonClick"  />
                    <Button Background="#FF6BB6F7" x:Name="ShowPediatricPSCsButton" Content="Pediatric Pscs" Width="200" Margin="2"   Height="30" FontSize="11" Click="GoToPediatricPSCsButtonClick"  />
                    <Button Background="#FF6BB6F7" x:Name="ShowPerinatalsButton" Content="Perinatals" Width="200" Margin="2"   Height="30" FontSize="11" Click="GoToPerinatalsButtonClick"  />
                    <Button Background="#FF6BB6F7" x:Name="ShowPrescriptionsButton" Content="Prescriptions" Width="200" Margin="2"   Height="30" FontSize="11" Click="GoToPrescriptionsButtonClick"  />
                    <Button Background="#FF6BB6F7" x:Name="ShowSurgeriesButton" Content="Surgeries" Width="200" Margin="2"   Height="30" FontSize="11" Click="GoToSurgeriesButtonClick"  />
                    <Button Background="#FF6BB6F7" x:Name="ShowSystemReviewsButton" Content="System Reviews" Width="200" Margin="2"   Height="30" FontSize="11" Click="GoToSystemReviewsButtonClick"  />
                    <Button Background="#FF6BB6F7" x:Name="ShowVaccinationsButton" Content="Vaccinations" Width="200" Margin="2"   Height="30" FontSize="11" Click="GoToVaccinationsButtonClick"  />
                    <Button Background="#FF6BB6F7" x:Name="ShowWorkFlowsButton" Content="Work Flows" Width="200" Margin="2"   Height="30" FontSize="11" Click="GoToWorkFlowsButtonClick"  />
                    <Button Background="#FF6290CE" x:Name="ShowPatientsButton" Content="Patients" Width="200" Margin="2"   Height="30" FontSize="11" Click="GoToPatientsButtonClick" />
                </StackPanel>
                </ScrollViewer>
<StackPanel Grid.Column="0" Grid.Row="1" Orientation="Vertical" VerticalAlignment="Top" Width="Auto">

<Controls:RadDataPager telerik1:StyleManager.Theme="Windows7" Height="33" x:Name="PatientDataPager" PageSize="24" Margin="1,-5,1,1"  Source="{Binding Items, ElementName=PatientDataGridTelerik}" DisplayMode="FirstLastPreviousNext" AutoEllipsisMode="Both" NumericButtonCount="0" IsTotalItemCountFixed="True" Style="{StaticResource RadDataPagerStyle1}"/>
<telerik:RadGridView telerik1:StyleManager.Theme="Windows7" d:LayoutOverrides="Height" ElementExporting="PatientDataGridTelerik_ElementExporting" IsFilteringAllowed="True"    ShowColumnHeaders="True" ShowColumnFooters="False" ShowGroupPanel="True"  HorizontalAlignment="Stretch" VerticalAlignment="Stretch"   AutoGenerateColumns="False" DataContext="{Binding Source={StaticResource PatientViewModel}}" ItemsSource="{Binding PatientCollection, Mode=TwoWay}" x:Name="PatientDataGridTelerik" Style="{StaticResource  RadGridViewStyle1}"   >
                             <i:Interaction.Triggers>
                               <i:EventTrigger EventName="SelectionChanged">
                                    <E2C:EventToCommand Command="{Binding SelectionChangedCommand}" PassEventArgsToCommand="True"  ></E2C:EventToCommand>
                                </i:EventTrigger>
                                <i:EventTrigger EventName="RowLoaded">
                                    <E2C:EventToCommand Command="{Binding RowLoadedCommand}" PassEventArgsToCommand="True"  ></E2C:EventToCommand>
                                </i:EventTrigger>
                            </i:Interaction.Triggers>
                            <telerik:RadGridView.Columns >
<telerik:GridViewDataColumn HeaderCellStyle="{StaticResource myCustomHeaderStyle}" x:Name="Patient_IdColumn" DataMemberBinding="{Binding Patient_Id}" Header="Patient Id" Width="25" />
<telerik:GridViewDataColumn HeaderCellStyle="{StaticResource myCustomHeaderStyle}"  x:Name="First_NameColumn" DataMemberBinding="{Binding First_Name}" Header="First Name" Width="SizeToHeader" />
<telerik:GridViewDataColumn HeaderCellStyle="{StaticResource myCustomHeaderStyle}"  x:Name="Last_NameColumn" DataMemberBinding="{Binding Last_Name}" Header="Last Name" Width="SizeToHeader" />
<telerik:GridViewDataColumn HeaderCellStyle="{StaticResource myCustomHeaderStyle}"  x:Name="HomePhoneNumberColumn" DataMemberBinding="{Binding HomePhoneNumber}" Header="Home Phone Number" Width="SizeToHeader" />
<telerik:GridViewDataColumn HeaderCellStyle="{StaticResource myCustomHeaderStyle}"  x:Name="WorkPhoneNumberColumn" DataMemberBinding="{Binding WorkPhoneNumber}" Header="Work Phone Number" Width="SizeToHeader" />
<telerik:GridViewDataColumn HeaderCellStyle="{StaticResource myCustomHeaderStyle}"  x:Name="CellPhoneNumberColumn" DataMemberBinding="{Binding CellPhoneNumber}" Header="Cell Phone Number" Width="SizeToHeader" />
<telerik:GridViewDataColumn HeaderCellStyle="{StaticResource myCustomHeaderStyle}"  x:Name="PersonalEmailColumn" DataMemberBinding="{Binding PersonalEmail}" Header="Personal Email" Width="SizeToHeader" />
<telerik:GridViewDataColumn HeaderCellStyle="{StaticResource myCustomHeaderStyle}"  x:Name="WorkEmailColumn" DataMemberBinding="{Binding WorkEmail}" Header="Work Email" Width="SizeToHeader" />
<telerik:GridViewDataColumn HeaderCellStyle="{StaticResource myCustomHeaderStyle}"  x:Name="Address1Column" DataMemberBinding="{Binding Address1}" Header="Address 1" Width="SizeToHeader" />
<telerik:GridViewDataColumn HeaderCellStyle="{StaticResource myCustomHeaderStyle}"  x:Name="Address2Column" DataMemberBinding="{Binding Address2}" Header="Address 2" Width="SizeToHeader" />
<telerik:GridViewDataColumn HeaderCellStyle="{StaticResource myCustomHeaderStyle}"  x:Name="ColoniaColumn" DataMemberBinding="{Binding Colonia}" Header="Colonia" Width="SizeToHeader" />
</telerik:RadGridView.Columns>
                             </telerik:RadGridView>

</StackPanel>
    </Grid>
  </ScrollViewer>
 </appControls:BusyIndicator>
</sdk:Page>

